package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Scanner;
import java.util.Vector;


public class MoviesLibrary extends Library<Movie> {

    public MoviesLibrary() {

        loadItems();
    }

    @Override
    protected void loadItems() {
        items.add(new Movie("Prestige", 2006, "Christopher Nolan", 8));
        items.add(new Movie("Barfi", 2012, "Anurag Basu", 8));

    }

    @Override
    public Vector<String> getAllItemDetails() {
        Vector<String> moviesDetails=new Vector<String>();
        String details;
        for(int i=0;i< items.size();i++) {

            details = items.elementAt(i).getTitle() + " ";
            details += items.elementAt(i).getYear() + " ";
            details +=items.elementAt(i).getDirector() + " ";
            if(items.elementAt(i).getRating() < 0 )
                details +="NA" + " ";
            else
                details += items.elementAt(i).getRating() + " ";

            moviesDetails.add(details);
        }
        return moviesDetails;

    }
}
